package com.boot.security.server.dao.mffl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.mffl.MfflCourierServicesCompany;

@Mapper
public interface MfflCourierServicesCompanyDao {

    @Select("select * from mffl_courier_services_company t where t.id = #{id}")
    MfflCourierServicesCompany getById(Long id);

    @Delete("delete from mffl_courier_services_company where id = #{id}")
    int delete(Long id);

    int update(MfflCourierServicesCompany mfflCourierServicesCompany);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into mffl_courier_services_company(name, number, createTime, updateTime, deleteState, deleteTime) values(#{name}, #{number}, #{createTime}, #{updateTime}, #{deleteState}, #{deleteTime})")
    int save(MfflCourierServicesCompany mfflCourierServicesCompany);
    
    int count(@Param("params") Map<String, Object> params);

    List<MfflCourierServicesCompany> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);

    /**
     * 获取所有快递公司信息
     * @param id
     * @return
     */
    @Select("select * from mffl_courier_services_company")
    List<MfflCourierServicesCompany> getAll();
}
